#ifndef HASHMAPSTRINGFIX_H_
#define HASHMAPSTRINGFIX_H_

/**
 * different implementations of the STL put hash_map under different namespaces this
 * makes it easier to change it if compiling under a different compiler.
 * for example:
 * GNU g++ -> __gnu_cxx
 * Visual C++ .NET 2003 -> stdext
 */
#define HASH_MAP_NAMESPACE __gnu_cxx


/**
 * Fix hash_map so that it can use a STL string as the key.
 * http://forums.devshed.com/c-programming-42/tip-about-stl-hash-map-and-string-55093.html
 * BEGIN FIX 
 **/
namespace HASH_MAP_NAMESPACE                                                                                 
{                                                                                             
  template<> struct hash< std::string >                                                       
  {                                                                                           
    size_t operator()( const std::string& x ) const                                           
    {                                                                                         
      return hash< const char* >()( x.c_str() );                                              
    }                                                                                         
  };                                                                                          
}          
/** END FIX **/


#endif /*HASHMAPSTRINGFIX_H_*/
